package demo;

public class factorial {
	public static void main(String[] args) {
		System.out.println(jie(10));
	}

	public static int jie(int x) {

//		if (x == 1) return 1;
//		return x * jie(x - 1);
		if(x == 1)return 1;
		int res = 1;
		while(x > 0) {
			res *=x;
			x --;
		}
		return res;
	}
}
